<html><head><title>Global</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="5">Global</font></b></p>

<br><b>Syntax</b><blockquote><pre><font face="Courier New, Courier, mono"size="2"><b><font color="#006666">Global</font></b>[.&#060;type&#062;] &#060;variable[.&#060;type&#062;]&#062; [= &#060;expression&#062;] [, ...]
</font></pre></blockquote>
<b>Description</b><br><blockquote>


<b><font color="#006666">Global</font></b> provides the ability for <a href="../reference/variables.html">variables</a> to be defined as global, i.e., 
variables defined as such may then be accessed within a <a href="../reference/procedures.html">Procedure</a>. In this case the 
command <b><font color="#006666">Global</font></b> must be called for the according variables, <b>before</b> the declaration of the procedure. 
Each variable may have a default value directly assigned to it. If a type is specified for a variable after <b><font color="#006666">Global</font></b>, 
the default type is changed through the use of this declaration.  <b><font color="#006666">Global</font></b> may also be used with <a href="../reference/dim.html">arrays</a>, 
<a href="../reference/newlist.html">lists</a> and <a href="../reference/newmap.html">maps</a>. <br>

<br>
In order to use local variables within a procedure, which have the same name as global variables, 
take a look at the <a href="../reference/protected.html">Protected</a> and <a href="../reference/static.html">Static</a> keywords. 

</blockquote><p><b>Example:</b> With variables</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">Global</font></b> a.l, b.b, c, d = 20
  
  <b><font color="#006666">Procedure</font></b> <font color="#006666">Change</font>()
    <b><font color="#006666">Debug</font></b> a  <font color="#006666">; Will be 10 as the variable is global</font>
  <b><font color="#006666">EndProcedure</font></b>
  
  a = 10
<font color="#006666">  Change</font>()
</font></pre>

<br>
</blockquote><p><b>Example:</b> With array</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">Global</font></b> <b><font color="#006666">Dim</font></b> <b><font color="#006666">Array</font></b>(2)
  
  <b><font color="#006666">Procedure</font></b> <font color="#006666">Change</font>()
    <b><font color="#006666">Debug</font></b> <b><font color="#006666">Array</font></b>(0)  <font color="#006666">; Will be 10 as the array is global</font>
  <b><font color="#006666">EndProcedure</font></b>
  
  <b><font color="#006666">Array</font></b>(0) = 10
<font color="#006666">  Change</font>()
</font></pre>

<br>
</blockquote><p><b>Example:</b> With default type</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <font color="#006666">; 'Angle' and 'Position' will be a float, as they didn't have a specified type</font>
  <font color="#006666">;</font>
  <b><font color="#006666">Global</font></b>.f Angle, Length.b, Position

</font></pre>
</body></html>